package com.example.springstack.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author qiangfanghao
 * @date
 * 角色表
 */
@Data
@Entity
@Table(name = "role")
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID自增加配置:
     *     @GenericGenerator(name = "HibAssigned", strategy = "native")
     *     @GeneratedValue(generator = "HibAssigned")
     *     @TableId(type = IdType.AUTO)
     */
    @Id
    @GenericGenerator(name = "HibAssigned", strategy = "native")
    @GeneratedValue(generator = "HibAssigned")
    @TableId(type = IdType.AUTO)
    @Column(name = "id", length = 20, nullable = false, unique = true)
    private Long id;

    /**
     * 创建时间
     */
    @Column(name = "create_time", columnDefinition = "bigint(20)",nullable = false)
    private Long createTime;

    /**
     * 创建人
     */
    @Column(name = "creator", columnDefinition = "varchar(64)",nullable = false)
    private String creator;

    /**
     * 角色名称
     */
    @Column(name = "name", columnDefinition = "varchar(64)",nullable = false)
    private String name;

    /**
     * 角色状态
     */
    @Column(name = "status", columnDefinition = "varchar(32)",nullable = false)
    private String status;

    /**
     * 描述
     */
    @Column(name = "description", columnDefinition = "varchar(32)")
    private String description;

    public Role() {
    }
}
